﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Collections.ObjectModel;
using HigLabo.WindowsAzure.RestService.Extensions;

namespace HigLabo.WindowsAzure.RestService.ServiceManagement
{
    public class Certificate
    {
        public static readonly String ElementName = "Certificate";

        public String Data { get; private set; }
        public String CertificateUrl { get; private set; }
        public String Thumbprint { get; private set; }
        public String ThumbprintAlgorithm { get; private set; }

        public Certificate(XElement xml)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            /*Certificate*/
            this.CertificateUrl = xml.ValueOrEmpty("CertificateUrl");
            this.Thumbprint = xml.ValueOrEmpty("Thumbprint");
            this.ThumbprintAlgorithm = xml.ValueOrEmpty("ThumbprintAlgorithm");
            this.Data = xml.ValueOrEmpty("Data");
        }
    }
}
